package cn.bdqn.or.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;import java.util.List;
import cn.bdqn.or.dao.OrderMapper;
import cn.bdqn.or.pojo.Order;

@Service("orderService")
public class OrderService {

	@Autowired
	private OrderMapper orderMapper;


	public Integer countByOrderNum(Integer orderNum) {
		return orderMapper.countByOrderNum(orderNum);
	}


	public List<Order> selectByAddress(String address) {
		return orderMapper.selectByAddress(address);
	}


	public List<Order> queryAll() {
		return orderMapper.queryAll();
	}


	public List<Order> selectByType(String type) {
		return orderMapper.selectByType(type);
	}


	public int updateIssuanceStatusByOrderId(Integer updatedIssuanceStatus, String orderId) {
		return orderMapper.updateIssuanceStatusByOrderId(updatedIssuanceStatus, orderId);
	}


	public List<Order> selectByOrderId(String orderId) {
		return orderMapper.selectByOrderId(orderId);
	}


	public int updatePayStatusAndRefundStatusAndIssuanceStatusAndReceivingStatusByOrderId(Integer updatedPayStatus, Integer updatedRefundStatus, Integer updatedIssuanceStatus, Integer updatedReceivingStatus, String orderId) {
		return orderMapper.updatePayStatusAndRefundStatusAndIssuanceStatusAndReceivingStatusByOrderId(updatedPayStatus, updatedRefundStatus, updatedIssuanceStatus, updatedReceivingStatus, orderId);
	}

	public List<Order> selectByOrderIdOrOrderDate(String orderId, Date orderDate) {
		return orderMapper.selectByOrderIdOrOrderDate(orderId, orderDate);
	}

	public List<Order> selectByRefundStatus(Integer refundStatus) {
		return orderMapper.selectByRefundStatus(refundStatus);
	}

	public Integer addOrderDataOfDatasource(List<Order> list){
		return orderMapper.addOrderDataOfDatasource(list);
	}
}





